Repository navigation
fix(eew): keep cancelled, stale and out-of-order alerts honest - #616
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5 tasks done
whes1015
force-pushed
the
fix/eew-cancel-and-ordering
branch
from
October 16, 2026 18:19
0f65446 to
e04d8da
Compare
This was referenced Oct 16, 2026
Member
Author
whes1015
added this pull request to stack #626
October 16, 2026 19:21
Platform: all Fix(zh-Hant): 地震速報被發布單位取消後會標示「已取消」,不再倒數、預估所在地震度、畫震波圈或語音播報 Fix(en-US): a cancelled earthquake alert is marked as cancelled instead of still counting down, estimating local shaking, drawing wave rings and being read aloud
Platform: all Fix(zh-Hant): 切換連線伺服器時,地震速報不會再從較新的報數退回較舊的報數 Fix(en-US): an earthquake alert no longer steps back to an older report after the app switches servers
Platform: all Fix(zh-Hant): 速報伺服器停止更新時,地震速報不會再一直停留在畫面上;已取消的速報顯示三分鐘後移除 Fix(en-US): an earthquake alert no longer stays on screen indefinitely when the server stops updating it, and a cancelled one clears after three minutes
Platform: all Fix(zh-Hant): 同時有多筆地震速報時,首頁與語音播報會優先顯示震波尚未抵達、所在地預估震度最高的那一筆,已取消的排在最後 Fix(en-US): with several earthquake alerts at once, Home and the spoken announcement now lead with the one whose S-wave has not reached you yet and that shakes your location hardest, with cancelled ones last
Platform: all Fix(zh-Hant): 地震速報連線中斷時,首頁與強震監視器會顯示「地震速報連線中斷,重新連線中」,不再以空白呈現而被誤認為平安無事 Fix(en-US): Home and the seismic monitor now say when the earthquake alert connection is lost, instead of showing an empty space that reads as all-clear
Platform: all Fix(zh-Hant): 震波倒數改以毫秒精度計算並對齊時鐘整秒更新,「已抵達」會在預估抵達的瞬間切換,不再提早或延遲最多一秒 Fix(en-US): the S-wave countdown is now computed to the millisecond and ticks on the clock's whole seconds, so "Arrived" switches at the estimated moment instead of up to a second early or late
whes1015
force-pushed
the
fix/eew-cancel-and-ordering
branch
from
October 16, 2026 19:31
e04d8da to
2b3bcd6
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
這個 PR 做了什麼
讓地震速報(EEW)在幾種邊界情況下不再誤導使用者:被取消的速報照樣以警報顯示、伺服器落後時卡片的報數倒退、連線斷掉後舊速報一直留在畫面上、多則速報同時發布時挑錯主要的那則,以及速報連線中斷時首頁看起來像「沒有警報」。
status的意義(查證結果)API 的
status是各發布單位原樣轉傳的狀態碼,取消的代碼依單位而不同:eew.tsL81、L159eew.tsL159、L225;trem-monitoruse-trem-data.tsnied)internal/models/eew.go:24、fetcher/nied.go:134-137;Nginxnats.lua原樣轉傳final是另一回事,只表示該單位的最後一報,和取消無關。app 把 2 和 3 都當作取消,不認得的值一律當一般速報,讀錯也絕不會藏掉一則警報。對照表寫在eew.dart的註解裡。改動內容
正式程式碼
2908b670取消的速報顯示為「已取消」fd1bad3c伺服器落後時保留最新一報eew_feed.dart):每個「單位+事件」只保留最大的報數,卡片不會從第 3 報退回第 2 報,也不會遺失取消狀態;伺服器移除的事件仍會立刻消失。EewRealtimeSource.fetch,串流和 fix(eew): detect and recover from silently dropped live feeds #614 的輪詢回退兩條路都會經過。fea74991停止更新的速報會自動移除AppTime)計算,常數都寫明物理依據:一般在發震後 250 秒;深度 ≥150 km、規模 ≥6 或警報延長到 400 秒;取消後 180 秒;硬上限 1 小時。19711161多則速報時先顯示、先播報最重要的那則eew_priority.dart):還沒到達的優先,再來是本地震度最大,再來是最新一報;取消的排最後。reportTime(JSON 的time)。2f43c329速報連線中斷時明確告知2b3bcd66S 波倒數準確到抵達的那一刻測試
相關 issue
沒有對應的 issue,是檢查速報顯示流程時發現的。
怎麼驗
tool/commit.sh --push通過(analyze、codegen、全部 Dart 測試)。檢查清單
tool/check/commits.sh通過tool/commit.sh --push)AppLocalizations,12 個語系都有翻譯